from langchain_core.tools import tool
from pydantic import BaseModel,Field


class CalculatorInput(BaseModel):
    a:int = Field(description="第一个数字")
    b:int = Field(description="第二个数字")

# 定义一个工具 结合pydantic做数据格式声明 
@tool("multiplication-tool",args_schema=CalculatorInput,return_direct=True)
def multiply(a:int,b:int) -> int:
    """Multiply two numbers together."""
    return a * b

# 输出和该工具相关的一些属性
print(multiply.name)
print(multiply.description)
print(multiply.args)